// -----------------------------------------------------------------
// IconModal
// -----------------------------------------------------------------

//.IconModal[data-open="open"] {
//  display: block;
//}

.IconModal {
  position: fixed;
  //display: none;
  inset: 0;
  margin: auto;
  width: 54rem;
  min-height: 1rem;
  max-width: 100vw;
  max-height: 100vh;
  overflow: auto;
  padding: 1rem 1.5rem;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  border-radius: .75rem;
  box-shadow: 0 0 1rem 0 #0000004a;
  border: 1px solid var(--bs-secondary-border-subtle);
  // A couple of years later, I'm still not sure why I need to set this to 0
}

.IconModal__header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-block-end: .75rem;
  border-block-end: 1px solid var(--bs-secondary-bg-subtle);
  padding-block-end: .5rem;
}

.IconModal__title {
  font-size: 1rem;
  font-family: var(--font-family-code);
  margin: 0;
  text-align: center;
  width: 100%;
}

.IconModal__header button {
  opacity: .25;
  position: absolute;
  right: .75rem;
}

.IconModal__header button:hover {
  opacity: 1;
}

.IconModal__title span:first-child {
  color: var(--bs-code-color);
}

.IconModal__body {
  display: grid;
  gap: 1.5rem;
}

.IconModal__icon {
  aspect-ratio: 1;
  display: flex;
  place-content: center;
  border-radius: 0.75rem;
  color: var(--bs-secondary-border-subtle);
}

.IconModal__icon--grid {
  background-image: linear-gradient(currentColor 1px, transparent 1px), linear-gradient(to right, currentColor 1px, transparent 1px);
  background-size: 12% 12%;
  background-blend-mode: soft-light;
  background-position: center center;
  color: var(--bs-secondary-border-subtle);
  border: 1px solid var(--bs-secondary-border-subtle);
  background-color: rgb(9, 16, 17);
  svg {
    color: var(--bs-body-color);
  }
}

.IconModal__icon--check {
  background-image: repeating-linear-gradient(45deg, var(--color-text) 25%, transparent 25%, transparent 75%, var(--color-text) 75%, var(--color-text)), repeating-linear-gradient(45deg, var(--color-text) 25%, transparent 25%, transparent 75%, var(--color-text) 75%, var(--color-text));
  background-position: 0 0, 20px 20px;
  background-size: calc(2 * 20px) calc(2 * 20px);
  --color-text: var(--bs-border-color-translucent);
  color: var(--color-secondary);
}


.IconModal__icon img {
  --invert: 0%;
  width: 75%;
  height: auto;
  filter: invert(var(--invert));
}
[data-bs-theme="dark"] .IconModal__icon img {
  --invert: 1;
}

.IconModal img {
  opacity: 10%;
}
.IconModal[open] img {
  opacity: 100%;
}

.IconModal[data-open="open"] .IconModal__icon img {
  animation: icon-loading 250ms forwards;
}

.IconModal__media .IconModal__icon img {
  --invert: 100%;
}
.IconModal__icons .IconModal__icon img {
  --invert: 0%;
}

.IconModal__color > img {
  --invert: 0 !important;
}

@keyframes icon-loading {
  0% {
    transform: scale(.95);
    filter: blur(5px) invert(var(--invert));
  }
  80% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
    filter: blur(0px) invert(var(--invert));
  }
}

.IconModal__icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: .75rem;
  gap: .75rem;
  opacity: .5;
}

.IconModal__icons .IconModal__icon {
  border-radius: .5rem;
}

.IconModal__icons .IconModal__icon:first-child {
  background: var(--bs-body-color);
}


.IconModal__icons .IconModal__icon:last-child {
  background: white;
  filter: invert(1) !important;
}

.IconModal::backdrop {
  backdrop-filter: blur(3px);
  background-color: rgba(7, 7, 7, 0.05);
}

.IconModal__main {
  min-width: 0;
}

.IconModal__code {
  font-size: 0.8rem;
  font-family: var(--font-family-code);
  padding: 0.35rem 0.5rem;
  border-radius: .5rem;
  border: 1px solid var(--bs-dark-border-subtle);
  background: var(--bs-secondary-bg);
  overflow: hidden;
  position: relative;
  opacity: .8;
}
.DataList__item.IconModal__code {
  width: 100%;
}

.IconModal__code button {
  opacity: .25;
  position: absolute;
  right: 0;
  top: .5rem;
}

.IconModal__code:hover {
  opacity: 1;

  button {
    opacity: 1;
  }
}

.IconModal__code pre {
  margin: 0;
  overflow: hidden;
  padding: .5rem;
  line-height: 1.7;
  max-height: var(--height, 3rem);
}
.IconModal__code pre code {
  white-space: break-spaces;
}

.IconModal__code span {
  color: var(--bs-code-color);
}

.IconModal__copy {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
}

.IconModal__main h3 {
  padding-top: 1.5rem;
  line-height: 1;
  color: var(--bs-body-color);
  font-family: var(--font-family-text);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0;
  opacity: 0.95;
  margin-bottom: 0.75rem;
  font-stretch: semi-condensed;
}

.IconModal__main h3:first-child {
  padding-top: 0;
}

.IconModal__main .TabBody {
    padding-block-end: 0;
}

@media screen and (max-width: 768px) {
  .IconModal {
    padding: .5rem;
    margin: .5rem;
    width: auto;
    height: auto;
  }
}
@media screen and (min-width: 768px) {
  .IconModal__body {
    grid-template-columns: 300px 1fr;
  }
}
